package com.bml.architect.rocketmq.web;

import com.bml.architect.rocketmq.producers.DefaultProducer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/stream")
public class StreamController {

    @Resource
    private DefaultProducer defaultProducer;

    @RequestMapping("/v1")
    public String send(@RequestParam(name = "msg") String msg) {
        defaultProducer.sendMsg(msg);
        return "send Msg is success!";
    }
}
